{% extends "afcp/base.html" %}
{% comment %}
<!--
  Copyright (C) 2008 ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
  - http://heavyz.blogspot.com/
  - http://buggarden.blogspot.com/

  Created on 2008-10-28.
  $Id: admin.html 289 2008-12-01 13:40:34Z heavyzheng $
-->
{% endcomment %}

{#------------------------------------------------------------------------------------------------#}

{% block html_head %}

<title>AFCP Admin Console</title>

{% endblock %}{# html_head #}

{#------------------------------------------------------------------------------------------------#}

{% block header %}
{% endblock %}{# header #}

{#------------------------------------------------------------------------------------------------#}

{% block sidebar_and_content %}

{% if is_admin_ %}

  <h2>AFCP Admin Console</h2>
  
  {% if error %}
    <div class="error message">
      {{ error|escape }}
    </div>
  {% endif %}
  
  {% if info %}
    <div class="info message">
      {{ info|escape }}
    </div>
  {% endif %}
  
  <div class="section">
    <h3>AFCP User Profiles</h3>
    <div>
      <ul>
        {% for profile in profiles.object_list %}
          <li>{{ profile.names }} : {{ profile.key.name }} : {{ profile.roles }}</li>
        {% endfor %}
      </ul>
    </div>
    <div>
      <form action="." method="POST">
        Add a new editor (email):
        <input type="hidden" name="action" value="add_editor"/>
        <input type="text" size="30" name="email"/>
        <input type="submit" value="Add"/>
      </form>
    </div>
  </div>
  
{% else %}{# not is_admin_ #}

  <div class="error message">
    You are not allowed to access this page.
    {% if user_ %}
      (You are logged-in as {{ user_.email }})
    {% else %}
      (You are not logged-in)
    {% endif %}
  </div>
  <div>
    <a href="/afcp/">Return to AFCP home.</a>
  </div>

{% endif %}{# is_admin_ #}

{% endblock %}{# sidebar_and_content #}




